package com.fourforfo.fourmall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fourforfo.common.utils.PageUtils;
import com.fourforfo.fourmall.product.entity.BrandEntity;
import com.fourforfo.fourmall.product.entity.CategoryBrandRelationEntity;

import java.util.List;
import java.util.Map;

/**
 * 品牌分类关联
 *
 * @author fourforfo
 * @email fourforfo@gmail.com
 * @date 2022-06-15 21:04:46
 */
public interface CategoryBrandRelationService extends IService<CategoryBrandRelationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveDetail(CategoryBrandRelationEntity categoryBrandRelation);

    //当brandName有变化时，将更新同步到CategoryBrandRelation表
    void updateBrand(Long brandId, String name);

    //当categoryName有变化时，将更新同步到CategoryBrandRelation表
    void updateCategory(Long catId, String name);

    /**
     * 获取当前分类的所有品牌
     * @param catId 分类id
     * @return 品牌实体类集合
     */
    List<BrandEntity> listBrandByCatId(Long catId);
}

